.NET Framework Class Library |
ConcurrentQueue<(Of <(T>)>)..::.CopyTo Method |
ConcurrentQueue<(Of <(T>)>) Class See Also Send Feedback |
Copies the ConcurrentQueue<(Of <(T>)>) elements to an existing one-dimensional Array, starting at the specified array index.
Namespace:
System.Collections.Concurrent
Assembly:
System.Threading (in System.Threading.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Sub CopyTo ( _ array As T(), _ index As Integer _ ) |
C# |
---|
public void CopyTo( T[] array, int index ) |
Parameters
- array
- Type: array<
T
>[]()[]
The one-dimensional Array that is the destination of the elements copied from the ConcurrentQueue<(Of <(T>)>). The Array must have zero-based indexing.
- index
- Type: System..::.Int32
The zero-based index in array at which copying begins.
Implements
IProducerConsumerCollection<(Of <(T>)>)..::.CopyTo(array<T>[]()[], Int32)Exceptions
Exception | Condition |
---|---|
System..::.ArgumentNullException | array is a null reference (Nothing in Visual Basic). |
System..::.ArgumentOutOfRangeException | index is less than zero. |
System..::.ArgumentException | index is equal to or greater than the length of the array -or- The number of elements in the source ConcurrentQueue<(Of <(T>)>) is greater than the available space from index to the end of the destination array. |